#!/bin/bash
#Show Media Details
#by John Lehr (c) 2009

OUTPUT="$(mktemp)"

echo -e "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" |  \
	while read FILENAME; do
		echo "$FILENAME:" >> $OUTPUT
		
		if [ "$(file -bi "$FILENAME" | grep mp3)" != "" ]; then
			id3tool $FILENAME | tail +2 - >> $OUTPUT
		elif [ "$(file -bi "$FILENAME" | grep mp4)" != "" ]; then
			AtomicParsley "$FILENAME" -t >> $OUTPUT 
		else
			echo "Not an mp3/mp4 file." >> $OUTPUT
		fi
		
		echo "" >> $OUTPUT
	done

gedit $OUTPUT
rm $OUTPUT

exit 0
